//
//  TRViewMaker.h
//  TRView
//
//  Created by cry on 2017/8/25.
//  Copyright © 2017年 cry. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class TRViewMaker;
@class TRView;
typedef void(^TRViewContainBlock)(TRViewMaker *maker);

typedef NS_ENUM(NSUInteger, TRViewType) {
    TRViewTypeSoild,
    TRViewTypeText,
    TRViewTypeImage,
};

typedef NS_ENUM(NSUInteger, TRLayoutType) {
    TRLayoutTypeVertical,
    TRLayoutTypeHorizontal,
    TRLayoutTypeAbsolute,
};

//typedef NS_ENUM(NSUInteger, TRLayoutType) {
//    TRLayoutTypeLinear,
//};

@interface TRViewMaker : NSObject

@property (nonatomic, strong) TRView *addSoild;

+ (TRViewMaker *)maker;

- (TRView *(^)(TRViewType))addView;
- (UIView *(^)())initView;

@end

@interface TRView : NSObject

/**
 View's attribute.
 */
- (TRView *(^)(NSString *))text;
- (TRView *(^)(UIColor *))color;
- (TRView *(^)(UIImage *))image;

/**
 View's layout attribute.
 */
- (TRView *(^)(CGFloat ))width;
- (TRView *(^)(CGFloat ))height;
- (TRView *(^)(CGFloat ))left;
- (TRView *(^)(CGFloat ))top;
- (TRView *(^)(CGFloat ))right;
- (TRView *(^)(CGFloat ))bottom;

- (TRView *)axisHorizontalContains:(TRViewContainBlock)block;
- (TRView *)axisVerticalContains:(TRViewContainBlock)block;
- (TRView *)contains:(TRViewContainBlock)block;

@end
